<?php

namespace App\Http\Controllers\Api\V1\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class PointsProductResource extends JsonResource
{
    public function toArray($request)
    {
    	$resource = $this->resource;
    	
        return [
        	'id' => (int)$resource->id,
	        'image' => img_path($resource->image),
            'title' => $resource->title,
            'price' =>$resource->price,
            'stock' =>$resource->stock,
            'points' =>$resource->points,
            'coupon'=>$resource->coupon,
	        'created_at' => (string)$resource->created_at,
        ];
    }
}
